# 多态

class Dog:
    def __init__(self, name):
        self.name = name

    def game(self):
        print("%s 蹦蹦跳跳的玩耍" % self.name)


class Xiaotianquan(Dog):
    def game(self):
        print("%s 我是飞得玩耍" % self.name)


class Person:

    def __init__(self, name):
        self.name = name

    def game_with_dog(self, dog):
        print("%s 和 %s 快乐的玩耍" % (self.name, dog.name))
        # 让狗玩
        dog.game()


dog = Dog("小狗")
xiaotianquan = Xiaotianquan("哮天犬")
person = Person("小明")
person.game_with_dog(dog)
person.game_with_dog(xiaotianquan)
